home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 January
/
PCWorld_2007-01_cd.bin
/
v cisle
/
autoit
/
autoit-v3.2.0.1-setup.exe
/
Examples
/
Helpfile
/
_GUICtrlTreeViewSetState.au3
< prev
next >
Wrap
Text File
|
2006-06-17
|
925b
|
38 lines
#include <GUIConstants.au3>
#include <GuiTreeView.au3>
Opt("MustDeclareVars", 1)
Dim $h_GUI, $Msg, $treeview, $h_search, $s_file, $h_item
$h_GUI = GUICreate("TreeView UDF Sample", 220, 220)
$treeview = GUICtrlCreateTreeView(10, 10, 200, 200, -1, $WS_EX_CLIENTEDGE)
GUICtrlSetImage(-1, "shell32.dll", 3, 4)
GUICtrlSetImage(-1, "shell32.dll", 4, 2)
GUISetState()
$h_search = FileFindFirstFile("C:\*.*")
If $h_search <> -1 Then
While 1
$s_file = FileFindNextFile($h_search)
If @Error Then ExitLoop
If Not StringInStr(FileGetAttrib("C:\" & $s_file), "D") Then ContinueLoop
$h_item = _GUICtrlTreeViewInsertItem($treeview, $s_file)
If StringInStr(FileGetAttrib("C:\" & $s_file), "H") Then
_GUICtrlTreeViewSetState($treeview, $h_item, $TVIS_CUT)
EndIf
WEnd
EndIf
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Exit